package com.common.retrofit.methods;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.service.HaiNingService;

import rx.Observable;
import rx.Subscriber;

public class SetNewPswByCodeMethods extends BaseMethods {

    private static SetNewPswByCodeMethods m_ins = null;

    public static SetNewPswByCodeMethods getInstance() {
        if (m_ins == null) {
            synchronized (SetNewPswByCodeMethods.class) {
                if (m_ins == null) {
                    m_ins = new SetNewPswByCodeMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "User/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }


    public void forgetPwd(Subscriber<Object> subscriber,
                      String username ,
                      String checkcode ,String newpwd  ) {
        Observable observable = initService().forgetPwd(System.currentTimeMillis()+"",
                "d1d906d6f160d927b6d8337e085697fc",username,checkcode,newpwd
        );
        toSubscribe(observable, subscriber);
    }
}
